#ifndef _CHDictionary_H_
#define _CHDictionary_H_
#include "../cppjieba/Jieba.hpp"
#include<set>
#include <stdlib.h>
#include<iostream>
#include<unordered_set>
#include<unordered_map>
#include<map>
#include<vector>
#include<string>
#include<fstream>
#include <dirent.h>
using std::ifstream;
using std::ofstream;
using std::cout;
using std::endl;
using std::pair;
using std::map;
using std::vector;
using std::set;
using std::string;
using std::unordered_map;
using std::unordered_set;
class CHDictionary
{
public:
    /* Dictionary(const string &dir)//初始化目录 */
    /* :_dir(dir){ */

   // }
    CHDictionary();
    void readFile(const string &filename);//读取测试文件
    void writeFile(const string &filename);//指定写入词频文件
    void readStopFile(const string &filename);//读取停用词
    void writeIndex(const string &filename);//指定写入索引行号文件
    void getFiles();//测试文件存储
    cppjieba::Jieba setjieba(){
 const char * const DICT_PATH =
    "../include/cppjieba/dict/jieba.dict.utf8";
      const char * const HMM_PATH =
    "../include/cppjieba/dict/hmm_model.utf8";
      const char * const USER_DICT_PATH =
    "../include/cppjieba/dict/user.dict.utf8";
      const char* const IDF_PATH =
    "../include/cppjieba/dict/idf.utf8";
      const char* const STOP_WORD_PATH =
    "../include/cppjieba/dict/stop_words.utf8";
      cppjieba::Jieba jieba(DICT_PATH,HMM_PATH,USER_DICT_PATH,
                            IDF_PATH,STOP_WORD_PATH);
      return jieba;
    }
private:
   map<string,int> _dict;
   vector<string> _file;
   string _dir;
   cppjieba::Jieba _jieba;
   void jiebaWord(cppjieba::Jieba&,string &line,size_t &LineNumber);//jieba分词
   map<string,set<int>> _wordline;
   unordered_set<string> _stop_word;
};
#endif
